<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Swiper demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <!-- Link Swiper's CSS -->
    <link rel="stylesheet" href="css/swiper.css">
    <!-- Demo styles -->
    <style>
        body {
            background: #fff;
            font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
            font-size: 14px;
            color:#000;
            margin: 0;
            padding: 0;
        }
        .swiper-container {
            width: 100%;
            padding-top: 50px;
            padding-bottom: 50px;
        }
        .swiper-slide {
            background-position: center;
            background-size: cover;
            width: 300px;
            height: 300px;
            transition: 1s;
            transform: scale(.8,.8);
        }
        .swiper-container .swiper-slide-active {
            transform: scale(1,1);
        }
    </style>
</head>
<body>
<!-- Swiper -->
<div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide" style="background-image:url('images/nature1.jpg')"></div>
        <div class="swiper-slide" style="background-image:url('images/nature2.jpg')"></div>
        <div class="swiper-slide" style="background-image:url('images/nature3.jpg')"></div>
        <div class="swiper-slide" style="background-image:url('images/nature4.jpg')"></div>
        <div class="swiper-slide" style="background-image:url('images/nature5.jpg')"></div>
    </div>
</div>

<!-- Swiper JS -->
<script src="js/swiper.js"></script>

<!-- Initialize Swiper -->
<script>
    var swiper = new Swiper('.swiper-container', {
        grabCursor: true,
        //设定为true时，活动块会居中，而不是默认状态下的居左。
        centeredSlides: true,
        slidesPerView: 'auto',
//        spaceBetween:50,
        watchSlidesProgress:true,
        onInit:function (swiper) {
            swiper.wrapper.css({width: swiper.virtualSize + swiper.params.spaceBetween + 'px'});
//            var slideTransform = 'scale(1.2,1.2)';

//            slide.transform(slideTransform);
        },
        onProgress: function(swiper, progress){
            for (var i = 0; i < swiper.slides.length; i++){
                var slide = swiper.slides[i];
                es = slide.style;
//                es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = 'rotate('+360*slide.progress+'deg)';
            }
        }
    });
</script>
</body>
</html>